package mylibrary.collection;

import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;

public class QueueTest {

	public static void main(String[] args) {
		
		//Queue queue = new LinkedList();
		Queue queue = new PriorityQueue();
		
		queue.offer("world");
		queue.offer("hello");
		queue.offer("nihao");
		
		//System.out.println(queue.size());
		String str = null;
		
		//System.out.println(queue.peek());
		//System.out.println(queue.element());
		
		while((str=(String)queue.poll())!=null) {
			System.out.println(str);
		}
		System.out.println(queue.size());
		
	}
}
